home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-10-08 | 1.7 KB | 61 lines | [TEXT/PJMM] |
- {Cursor RXVW}
-
- {This is an example of an RXVW code resource}
- {To compile in Think Pascal:}
-
- { 1) Set Project Type to 'Code Resource'}
- { 2) Set the resource TYPE to 'RXVW'}
- { 3) Set the resource NAME to the resource type you are making a view for.}
- { In this example, the resource name must be 'CURS'}
- { 4) Add this file, DRVRRuntime.lib, and Interface.lib to the project}
- { 5) Compile the code resource.}
- { 6) Install it in ResX via the 'Externals->Install' menu.}
-
- {A unit of utilities is in the works to give access to ResX internals. I'm not }
- {releasing info on the Globals structure just yet. This will allow you to}
- {have access to the entire ResX environment.}
-
-
- unit ShowCursor;
-
-
- interface
- procedure main (ResHandle: Handle); {Handle of the current selected resource}
-
-
- implementation
- procedure main;
- var
- crsrHandle: CursHandle;
- rsrID: integer;
- rsrType: ResType;
- rsrName: Str255;
- HState: SignedByte;
-
-
- begin
-
- {For most views, you will only need the handle to the resource but in this case, we need}
- {to know the resource ID. In this example, we do a GetCursor so do not need to load the }
- {resource.}
-
- {This is necessary because GetCursor needs the resource ID but only the Handle is given.}
- GetResInfo(ResHandle, rsrID, rsrType, rsrName); {Get the resource id of the cursor}
-
- HState := HGetState(ResHandle); {This is mandatory!}
-
- crsrHandle := GetCursor(rsrID);
- SetCursor(crsrHandle^^);
-
-
- repeat
- until button;
-
- InitCursor;
-
- HSetState(ResHandle, HState); {This is mandatory!}
- {Do NOT release the resource or dispose the handle, ResX will do it if necessary. }
- {This is critical in case the resource is being used by a currently running application. }
-
- end;
- end.